<template>
    <div>
        <p>会员名: <input type="text" v-model="username" placeholder="输入名称"></p>
        <p>密码: <input type="password" v-model="password" placeholder="输入密码"></p>
        <p><button @click="login_app1">进入餐厅</button></p>
    </div>
</template>

<script>
    export default {
        name: "login_app1",
        data() {
            return {
                username: '',
                password: '',
            }
        },
        methods: {
            login_app1(){
                this.$axios({
                    url: 'app1/user/',
                    method: 'post',
                    data: {
                        username: this.username,
                        password: this.password
                    }
                }).then(resp=>{
                    alert(resp.data.msg);
                    if (resp.data.code==200){
                        sessionStorage.setItem('user', JSON.stringify(resp.data.user));
                        this.$router.push('/index_app1')
                    }
                })
            }
        },
        computed: {},
        filters: {},
        watch: {},
    }
</script>

<style scoped>

</style>
